#include<iostream>
#include<gtest/gtest.h>

#include "lib/sort.hpp"
using namespace std;
using namespace LearnAlgorithm;

namespace {
    class TestSort : public ::testing::Test {
    public:
        virtual void SetUp() {
            cout << "SetUp" << endl;
        }

        virtual void TearDown() {
            cout << "TearDown" << endl;
        }
    };

    TEST_F(TestSort, TestDirectInsertSorting) {
        bool test_flag = false;
        vector test_data = {3, 2, 1};
        vector test_data_save = test_data;
        vector test_result = {1 , 2, 3};
        ASSERT_EQ(test_result, DirectInsertSorting(test_data, false));
        ASSERT_EQ(test_data, test_data_save);

        ASSERT_EQ(test_result, DirectInsertSorting(test_data, test_flag));
        ASSERT_EQ(test_data, test_data_save);

        ASSERT_EQ(test_result, DirectInsertSorting(test_data, true));
        ASSERT_EQ(test_result, test_data);
    }
}
int main(int argc,char *argv[])
{
    ::testing::InitGoogleTest(&argc,argv);
    return RUN_ALL_TESTS();
}